package mallindex

import (
	"context"

	// "mall/common/jwt"
	// resultx "mall/common/result"
	"mall/common/utils/pointy"
	"mall/service/forum/api/internal/svc"
	"mall/service/forum/api/internal/types"
	// "mall/service/user/rpc/userclient"

	"github.com/zeromicro/go-zero/core/logx"
)

type GetGoodsCategoryListLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewGetGoodsCategoryListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetGoodsCategoryListLogic {
	return &GetGoodsCategoryListLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *GetGoodsCategoryListLogic) GetGoodsCategoryList(
	req *types.GetGoodsCategoryListReq,
	headers *[]*types.Header,
) (resp *types.GoodsCategoryListResp, err error) {
	// userId := jwt.GetUserId(l.ctx)

	resp = &types.GoodsCategoryListResp{
		BaseListInfo: types.BaseListInfo{
			Current:         uint64(1),
			PageSize:        uint64(10),
			HasNextPage:     false,
			HasPreviousPage: false,
		},
	}

	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(1)),
		Name:      pointy.GetPointer("上装"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/f89753a227d26a3fe9ccc6f975857bb6.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(2)),
		Name:      pointy.GetPointer("裤装"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/5bfffd6ad0d4483870f024a3ed936528.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(3)),
		Name:      pointy.GetPointer("特价区"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/8d32c254e2cb86d2d42c99b768d136b6.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(4)),
		Name:      pointy.GetPointer("裙装"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/d800327091f216e2c83db8af7b6be306.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(5)),
		Name:      pointy.GetPointer("套装"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/cfee29650d6ae58a4bb1f84a3d899450.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(6)),
		Name:      pointy.GetPointer("外套"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/6b3136cda73c99453ac93a1c5a9deebf.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(7)),
		Name:      pointy.GetPointer("秒杀"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/9a7356187fce687ce568ba7381685299.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(8)),
		Name:      pointy.GetPointer("内裤"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/7773b4c204280ba194514594f7070ac9.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(9)),
		Name:      pointy.GetPointer("袜子"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/60f41bf042d201b48a7115d22344320f.png"),
		LinkToUrl: pointy.GetPointer(""),
	})
	resp.List = append(resp.List, &types.GoodsCategoryInfo{
		Id:        pointy.GetPointer(uint64(10)),
		Name:      pointy.GetPointer("鞋"),
		ImageUrl:  pointy.GetPointer("https://cdn.it120.cc/apifactory/2019/04/09/cdb16ac9c66bc211b82bd947452526f4.png"),
		LinkToUrl: pointy.GetPointer(""),
	})

	return resp, nil
}
